const mongoose = require('mongoose')

const Evaluation = new mongoose.Schema({
  gid: {
    type: mongoose.ObjectId,
    required: true
  },
  uid: {
    type: mongoose.ObjectId,
    required: true
  },
  username: {
    type: String,
    required: true
  },
  star: {
    type: Number,
    required: true,
    min: 1,
    max: 5
  },
  content: {
    type: String,
    required: true
  },
  data: {
    type: Date,
    default: Date.now()
  }
})

module.exports = mongoose.model('evaluations', Evaluation)
